﻿@using HiLand.Utility.Entity
@model LogicStatusInfo
@{
    ViewBag.Title = "ChangePassword";

    bool isDisplayTip = false;
    string tipStatus = "success";
    string tipMessage = string.Empty;
    if(Model!=null)
    {
        isDisplayTip = true;
        if(Model.IsSuccessful==true)
        {
            tipStatus = "success";
            tipMessage = "Change password successfully.";
        }
        else
        {
            tipStatus = "error";
            tipMessage = "There is a error in changing passwod.";
        }
    }
    
    Guid userGuid= Guid.Empty;
    HiLand.Framework.BusinessCore.IBusinessUser currentUser= this.ViewBag.CurrentUser;
    if(currentUser!=null)
    {
        userGuid= currentUser.UserGuid;
    }
}
<h2>
    ChangePassword
</h2>

@if (isDisplayTip == true)
{
<div class="notification @tipStatus png_bg">
    <a href="#" class="close">
        <img src="@Url.Content("~/Content/NotificationImages/cross_grey_small.png")" title="Close this notification"
            alt="close" /></a>
    <div>
        @tipMessage
    </div>
</div>
}

@using (Html.BeginForm())
{
    <span>Original Password:</span> @Html.TextBox("passwordOld")<br />
    <span>New Password:</span> @Html.TextBox("passwordNew")<br />
    <span>Confirm New Password:</span> @Html.TextBox("passwordNewConfirm")<br />
    @Html.Hidden("userGuid", userGuid)
    <input class="button" type="submit" value="Submit" />
}


<script type="text/javascript">
    $(document).ready(function () {
        $("#aSettingSection").addClass("current");
        $("#aChangePassword").addClass("current");
    });
</script>
